{"ast":null,"code":"import * as React from 'react';\nimport LocaleContext from './context';\nimport defaultLocaleData from './en_US';\nvar LocaleReceiver = function LocaleReceiver(props) {\n  var _props$componentName = props.componentName,\n    componentName = _props$componentName === void 0 ? 'global' : _props$componentName,\n    defaultLocale = props.defaultLocale,\n    children = props.children;\n  var antLocale = React.useContext(LocaleContext);\n  var getLocale = React.useMemo(function () {\n    var _a;\n    var locale = defaultLocale || defaultLocaleData[componentName];\n    var localeFromContext = (_a = antLocale === null || antLocale === void 0 ? void 0 : antLocale[componentName]) !== null && _a !== void 0 ? _a : {};\n    return Object.assign(Object.assign({}, locale instanceof Function ? locale() : locale), localeFromContext || {});\n  }, [componentName, defaultLocale, antLocale]);\n  var getLocaleCode = React.useMemo(function () {\n    var localeCode = antLocale && antLocale.locale;\n    // Had use LocaleProvide but didn't set locale\n    if (antLocale && antLocale.exist && !localeCode) {\n      return defaultLocaleData.locale;\n    }\n    return localeCode;\n  }, [antLocale]);\n  return children(getLocale, getLocaleCode, antLocale);\n};\nexport default LocaleReceiver;\nexport var useLocaleReceiver = function useLocaleReceiver(componentName, defaultLocale) {\n  var antLocale = React.useContext(LocaleContext);\n  var getLocale = React.useMemo(function () {\n    var _a;\n    var locale = defaultLocale || defaultLocaleData[componentName];\n    var localeFromContext = (_a = antLocale === null || antLocale === void 0 ? void 0 : antLocale[componentName]) !== null && _a !== void 0 ? _a : {};\n    return Object.assign(Object.assign({}, typeof locale === 'function' ? locale() : locale), localeFromContext || {});\n  }, [componentName, defaultLocale, antLocale]);\n  return [getLocale];\n};","map":{"version":3,"names":["React","LocaleContext","defaultLocaleData","LocaleReceiver","props","componentName","defaultLocale","children","antLocale","useContext","getLocale","useMemo","_a","locale","localeFromContext","Object","assign","Function","getLocaleCode","localeCode","exist","useLocaleReceiver"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/locale/LocaleReceiver.js"],"sourcesContent":["import * as React from 'react';\nimport LocaleContext from './context';\nimport defaultLocaleData from './en_US';\nconst LocaleReceiver = props => {\n  const {\n    componentName = 'global',\n    defaultLocale,\n    children\n  } = props;\n  const antLocale = React.useContext(LocaleContext);\n  const getLocale = React.useMemo(() => {\n    var _a;\n    const locale = defaultLocale || defaultLocaleData[componentName];\n    const localeFromContext = (_a = antLocale === null || antLocale === void 0 ? void 0 : antLocale[componentName]) !== null && _a !== void 0 ? _a : {};\n    return Object.assign(Object.assign({}, locale instanceof Function ? locale() : locale), localeFromContext || {});\n  }, [componentName, defaultLocale, antLocale]);\n  const getLocaleCode = React.useMemo(() => {\n    const localeCode = antLocale && antLocale.locale;\n    // Had use LocaleProvide but didn't set locale\n    if (antLocale && antLocale.exist && !localeCode) {\n      return defaultLocaleData.locale;\n    }\n    return localeCode;\n  }, [antLocale]);\n  return children(getLocale, getLocaleCode, antLocale);\n};\nexport default LocaleReceiver;\nexport const useLocaleReceiver = (componentName, defaultLocale) => {\n  const antLocale = React.useContext(LocaleContext);\n  const getLocale = React.useMemo(() => {\n    var _a;\n    const locale = defaultLocale || defaultLocaleData[componentName];\n    const localeFromContext = (_a = antLocale === null || antLocale === void 0 ? void 0 : antLocale[componentName]) !== null && _a !== void 0 ? _a : {};\n    return Object.assign(Object.assign({}, typeof locale === 'function' ? locale() : locale), localeFromContext || {});\n  }, [componentName, defaultLocale, antLocale]);\n  return [getLocale];\n};"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,aAAa,MAAM,WAAW;AACrC,OAAOC,iBAAiB,MAAM,SAAS;AACvC,IAAMC,cAAc,GAAG,SAAjBA,cAAc,CAAGC,KAAK,EAAI;EAC9B,2BAIIA,KAAK,CAHPC,aAAa;IAAbA,aAAa,qCAAG,QAAQ;IACxBC,aAAa,GAEXF,KAAK,CAFPE,aAAa;IACbC,QAAQ,GACNH,KAAK,CADPG,QAAQ;EAEV,IAAMC,SAAS,GAAGR,KAAK,CAACS,UAAU,CAACR,aAAa,CAAC;EACjD,IAAMS,SAAS,GAAGV,K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